package org.xhy.aop.core;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

/**
 * @description: 目标方法的形参以及目标方法
 * @gitee: https://gitee.com/XhyQAQ
 * @copyright: B站: https://space.bilibili.com/152686439
 * @Author: Xhy
 * @CreateTime: 2024-01-09 10:04
 */
public class JoinPoint implements IJoinPoint{

    protected final Method method;
    private Object[] args;

    public JoinPoint(Method method,Object[] args) {
        this.method = method;
        this.args = args;
    }

    @Override
    public Object[] getArgs() {
        return args;
    }

    @Override
    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
        return method.getAnnotation(annotationClass);
    }
}
